package com.ncell.utils;

import java.util.Random;

public class Utils {

    private static final Random rand = new Random(55);

    public static int getRandomInt(double max) {
        return (int)(rand.nextDouble() * max);
    }
    
    public static double getRandom(double max) {
        return rand.nextDouble() * max;
    }

    public static double getRandom(double min, double max) {
        return min + rand.nextDouble() * (max - min);
    }

    public static float length(float x, float y, float x2, float y2) {
        float tx = x - x2;
        float ty = y - y2;
        return (float) Math.sqrt(tx * tx + ty * ty);
    }
}
